package cate.game.pvp.throne.data.ko;

import cate.game.role.RoleSimpleBase;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.HashMap;
import java.util.Map;

@NoteClass("冠军记录")
public class TBKoChampionRecord {

	@NoteField("赛季")
	public int season;

	@NoteField(value = "冠军记录",detail = "Map<等级组,决赛信息>")
	public Map<Integer, Record> champions = new HashMap<>();

	public void initialize() {
		if (champions == null) {
			champions = new HashMap<>();
		}
	}

	public void setChampion(int levelGroup,TBKoMatch match){
		champions.put(levelGroup, Record.of(match));
	}

	@NoteClass("决赛记录")
	public static class Record{

		@NoteField("a方简要信息")
		public RoleSimpleBase a;

		@NoteField("b方简要信息")
		public RoleSimpleBase b;

		@NoteField("胜利方")
		public byte winner;

		public Record() {
		}

		public static Record of(TBKoMatch match){
			Record record = new Record();
			record.a = match.a.copy();
			record.b = match.b.copy();
			return record;
		}
	}
}
